ebooktestfandomcom-20200214-history
The GCCE toolchain initiative
The Symbian Platform and GCCE There has always been a lot of interest among the developer community for cross platform, open source tools. It makes sense because of the agility it brings. We at Symbian are also committed to promote this, and as part of that one of the major steps is to enable GCCE as an alternative to RVCT. There has already been a lot of discussion and effort put in to compile the whole Symbian platform with GCCE and there are some more challenges ahead. One such challenge is that using GCCE may not be seen as commercially important by the larger foundation members. However, we see it as essential to enable contribution by the wider community. So, Symbian welcomes the community to come forward and help to make this happen faster. Who knows, if the community embraces GCCE, then it may be adopted as the way forward for the larger foundation members as well. This also opens the door to a whole new world of developing for Symbian using free tools on Linux and OS X. This page is a guide to set up the environment and capture all the efforts towards it. Setting up your Environment Instructions to set up a basic environment with the the latest PDK and PDT versions. Please ignore if you already have it. 1. The Product Development Toolkit (PDT) contains almost all the PC-based tools and documentation needed to develop code and create products based on the Symbian platform. Product Development Toolkit Quick Start 2.The Product Development Kit (PDK) is a full build of the Symbian platform along with the corresponding source code that is available under the Eclipse Public Licence v1.0 (EPL). It may be overlaid with an interim Symbian Software Kit (iSSK) for the source that can only be made available under the Symbian Foundation License (SFL). Product Development Kit Quick Start To help you get started faster we advise you to use the Kernel Taster Kit, which is a stripped down version of the PDK along with the sources for the kernel and baseports. Instructions for installing the Kernel Taster Kit could be found here Updating your PDT The official build system for Symbian is SBS2 (aka Raptor). You can get the GCCE supported version of Raptor from the http://developer.symbian.org/main/tools_and_kits/downloads/view.php?id=4&vId=1.5 Kits Section or also obtain Raptor directly from Mercurial. The SBS_2.12.1.zip archive contains a version of the SBS (Raptor) build framework that supports GCC. Please use this version instead of the 2.9.2_p2 version above if you intend to use the GCC toolchain Using GCCE The CSL ARM Toolchain must be downloaded from CodeSourcery. The path for downloading is here. CodeSourcery produces many different packages. The package you need is "Sourcery G++ Lite Edition for ARM", with Symbian OS as the target OS. After downloading , install it without any spaces in the installation path. Next, to make Raptor aware of your GCCE installation(s) you must set certain environment variables. Releases before Raptor 2.11.1: create an environment variable called GCCEBIN and set it to point to the bin directory that contains arm-none-symbianelf-g++.exe and friends: GCCEBIN=C:\Apps\CodeSourcery\GCCE\bin Releases starting 2.11.1 onwards: set the following environment variable to the bin directories inside your GCCE installations: SBS_GCCE432BIN=C:\Apps\CodeSourcery\GCCE432\bin SBS_GCCE433BIN=C:\Apps\CodeSourcery\GCCE433\bin SBS_GCCE441BIN=C:\Apps\CodeSourcery\GCCE441\bin and Raptor 2.11.1 onwards supports all three of these versions: 4.3.2, 4.3.3 and 4.4.1 Additional patch ups required for GCCE Additionally, we may also need to do a couple of tweaks to get GCCE4 fully working with the PDK. *Remove failing assertions in d32locd.h (Bug 255) Delete the following two lines from epoc32/include/d32locd.h __ASSERT_COMPILE(_FOFF(TLocalDriveCaps,iSize)%8 0); __ASSERT_COMPILE(_FOFF(TLocalDriveCapsV3,iFormatInfo.iCapacity) % 8 0); GCCE 4.x complains about these lines, saying warning: invalid access to non-static data member 'TLocalDriveCaps::iSize' of NULL object warning: (perhaps the 'offsetof' macro was used incorrectly) *Edit epoc32/include/gcce/gcce.h to provide correct definition for __WEAK__ #define __WEAK__ __attribute__((weak)) Instructions to build the Package The build command is sbs -c gcce_armv5 You can use -b bld.inf to use a bld.inf file else -s package_definition.xml (As from PDK_3.0.i package definitions are shipped with the PDK under the \build_info\package_definitions directory). The output goes into epoc32/release/armv5. GCCE is much stricter than RVCT for ANSI/ISO C/C++ compliance, so expect errors and warnings from code that compiles cleanly with RVCT. KernelHwServices Package To bring up a Symbian "textshell" on a H/W or QEMU , the Kernel and HwServices package is the building block which needs to be compiled independently with GCCE. This section of the document primarily focuses on that and the challenges. Some of the challenges we see are - * Compiler errors owing to the differences between the compilers. * Issues compiling the ARM bootstrap due to strict coupling between BOOTSTRAP.MK and ARM compilers. * Missing RVCT runtime -The Symbian Nano kernel uses the RVCT ARM runtime components statically and hence is very tightly coupled with the (RVCT). Few of those ARM runtime libs are c_a__un.l (ISO C and C++ basic runtime support), cpprt_a__u.l (ARM C++ runtime libraries). We are expecting to get proprietary versions of these libraries delivered from CodeSourcery in a future tool chain release, but if anyone wants to contribute open source versions that would be fantastic! > mkdir sf > mkdir sf/os > cd sf/os > hg clone -U https://developer.symbian.org/oss/FCL/sf/os/kernelhwsrv > cd kernelhwsrv > hg update -r COMPILER_COMPATIBILITY We are maintaining a branch GCCE_COMPATIBILITY and all the identifies fixes could be submitted there. That can then be taken up by the package owner for a merge to the FCL. In case of submitting a fix on the branch , please also file a bug request mentioning it as an "enhancement" and putting GCCE as the first word in the bug description. A current snapshot of bugs with GCCE and Symbian^3: KernelHwServices Package specific http://developer.symbian.org/bugs/buglist.cgi?quicksearch=GCCE bugs. Other Packages We encourage the community to take this up for other packages as well. The package owners/enthusiasts can clone the respective packages and give it a shot. Expect to get some errors because of the strictness of GCCE. Bugs already raised for compilation errors in other packages can be found on the Compiler Compatibility page. Following is the template for other packages. Feel free to update the contents - '< Package Name > ' If you are filling bugs, please mark them as an "enhancement request", and start the bug description with the word "GCCE". Having some details will help us maintain a backlog for a package to be GCCE compliant. How to test Do Known problems This is a collection of some known problems. Feel free to append to it *I use Raptor 2.10.1 and I am getting an error arm-none-symbianelf-ld: cannot find -lgcc during compilation Check the version of compiler you are using. Raptor doesn't yet support GCC-E 4.4.1. A quick workaround could be to go into the GCC-E installation directory and copy "libexec/gcc/arm-none-symbianelf/4.4.1" to "libexec/gcc/arm-none-symbianelf/4.3.2". * sbs complains if the RVCT22BIN environment variable is not defined. Workaround - define it as "ignored". *Can't build the whole package using the package definition file You should use the package definition files under the \build_info\package_definitions directory. Please also see More on the Package Definition Files. *Can't build ROM images - error message "To use new Symbian OS tools specify a default device using devices -setdefault" This message implies that you have previously installed an SDK for S60 or UIQ, and c:\Program Files\Common Files\Symbian\Tools in on your path before the \epoc32\gcc\bin path added in the installation instructions. The simplest workaround is to put \epoc32\gcc\bin first on the path, by typing "set path=\epoc32\gcc\bin;%path%". * TIP : Don't like seeing so many warnings with GCCE ; Go to your %SBS_HOME%\lib\config\gcce.xml file. Search for the name set name="CC_WARNINGS_CONTROL_OPTION" and change is as follows. '' '' Copy this section and then edit it to make a new report - thanks. Related Information Apps:Fundamentals of Symbian C++/Tool Chain How to test your development environment